<?php
namespace BP\DA;
class DBUrl {
	public $_DBUrlType;	// DBUrlType
	private function __init() { // default class members
		$this->_DBUrlType = DBUrlType::$AppCenterDSN;
	}
	public static function constructor__ () 
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	public static function constructor__DBUrlType ($type) // [DBUrlType type]
	{
		$me = new self();
		$me->__init();
		$me->setDBUrlType($type);
		return $me;
	}
	public function getDBUrlType () 
	{
		return $this->_DBUrlType;
	}
	public function setDBUrlType ($value) // [DBUrlType value]
	{
		$this->_DBUrlType = $value;
	}
	public function getDBVarStr () 
	{
		switch ($this->getDBType()) {
			case $Oracle:
				return ":";
			case $MySQL:
				return ":";
			case $MSSQL:
				return ":";
			case $Informix:
				return "?";
			default:
				return "@";
		}
	}
	public function getDBType () 
	{
		switch ($this->getDBUrlType()) {
			case $AppCenterDSN:
				return DBAccess::getAppCenterDBType();
			case $DBAccessOfOLE:
				return DBType::$Access;
			case $DBAccessOfOracle1:
				return DBType::$Oracle;
			default:
				throw new \Exception("不明确的连接");
		}
	}
}
?>
